#!/usr/env/bin python
# -*- coding: utf-8 -*-

# @Time    : 2020-07-17 9:57 上午
# @Author  : yangdy
# @File    : 2020-07-17.35. 搜索插入位置
# @Software: PyCharmCE
from typing import List


class Solution:
    def searchInsert(self, nums: List[int], target: int) -> int:
        ans = 0
        import bisect
        ans = bisect.bisect_left(nums, target)
        return ans


solve = Solution()

questions = [
    ([1, 3, 5, 6], 5),
    ([1, 3, 5, 6], 2),
]

for qi, q in enumerate(questions):
    print(f'#{qi}:', q)
    print(solve.searchInsert(q[0], q[1]))

